package com.wuliu.system.domain.dto;

import com.wuliu.common.utils.StringUtils;
import com.wuliu.common.core.domain.entity.BasCust;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author realue
 * @version 1.0
 * @date 2023-08-31 21:30
 */
@Data
@ApiModel
public class WxPushDto {
    @ApiModelProperty(value = "会员信息")
    private BasCust basCust;
    @ApiModelProperty(value = "模板业务类型1.签约成功通知 2.收益到账通知 3.优惠券领取成功通知 4.审核状态通知 5.审核通过通知 6.提现审核通知 7.卡券到期提醒")
    private Integer busiType;
    @ApiModelProperty(value = "类型1.小程序 2.公众号 3.全部")
    private Integer type;

    /* 签约成功通知 busiType=1 */
    @ApiModelProperty(value = "产品名称")
    private String productName;
    @ApiModelProperty(value = "温馨提示")
    private String prompt;
    /* 收益到账通知* busiType=2 */
    @ApiModelProperty(value = "收益金额")
    private String revenueAmount;
    @ApiModelProperty(value = "收益来源")
    private String sourceIncome;
    @ApiModelProperty(value = "到账时间")
    private String receiptTime;
    @ApiModelProperty(value = "类型")
    private String revenueType;
    /* 优惠券领取成功通知 busiType=3 */
    @ApiModelProperty(value = "优惠券详情")
    private String couponDetail;
    @ApiModelProperty(value = "商家名称")
    private String businessName;
    @ApiModelProperty(value = "过期时间")
    private String expiryTime;
    @ApiModelProperty(value = "卡券名称")
    private String couponName;
    /* 审核状态通知 busiType=4 */
    @ApiModelProperty(value = "审核反馈")
    private String auditFeedback;
    @ApiModelProperty(value = "审核事项")
    private String auditMatters;
    /* 审核通过通知 busiType=5 */
    @ApiModelProperty(value = "审核名称")
    private String auditName;
    @ApiModelProperty(value = "审核状态")
    private String auditStatus;
    @ApiModelProperty(value = "审核时间")
    private String auditTime;
    @ApiModelProperty(value = "审核事项")
    private String auditContent;
    /* 提现审核通知 busiType=6 */
    @ApiModelProperty(value = "昵称")
    private String nickName;
    @ApiModelProperty(value = "余额")
    private String balance;
    @ApiModelProperty(value = "提现金额")
    private String withdrawalAmount;
    @ApiModelProperty(value = "提现日期")
    private String withdrawalDate;
    /* 卡券到期提醒 busiType=7 */
    @ApiModelProperty(value = "卡券名称")
    private String cardName;
    @ApiModelProperty(value = "卡券面额")
    private String cardAmount;
    @ApiModelProperty(value = "适用范围")
    private String useScope;
    @ApiModelProperty(value = "有效期至")
    private String expiryDate;

    public boolean isValid() {
        if ((type == 1 && StringUtils.isEmpty(basCust.getAppletOpenId()))
                || (type == 2 && StringUtils.isEmpty(basCust.getPublicOpenId()))
                || (type == 3 && (StringUtils.isEmpty(basCust.getAppletOpenId()) || StringUtils.isEmpty(basCust.getPublicOpenId())))
                || StringUtils.isEmpty(basCust.getSysAccount())
                || StringUtils.isNull(type)
                || StringUtils.isNull(busiType)) {
            return false;
        } else {
            return true;
        }
    }
}
